package model

import (
	"gopkg.in/mgo.v2/bson"
	"svvenus/conf"
	"time"
)

// MailDoc
// @Description: 邮件
type MailDoc struct {
	Id             bson.ObjectId  `bson:"_id,omitempty"`
	MailType       int32          `bson:"MailType"`       //邮件类型
	Title          string         `bson:"Title"`          //邮件标题
	Body           string         `bson:"Body"`           //邮件正文
	SenderName     string         `bson:"SenderName"`     //发件人名字
	CreateTime     time.Time      `bson:"CreateTime"`     //邮件创建时间
	Read           bool           `bson:"Read"`           //已读
	Got            bool           `bson:"Got"`            //已领
	RecSource      int32          `bson:"RecSource"`      //邮件附件来源
	Awards         []conf.PcAward `bson:"Awards"`         //邮件附件
	//AllTimeReceive bool           `bson:"AllTimeReceive"` //false=注册时间在发送邮件之前的才能收到全服邮件 true=无论是否在发邮件之前注册都能收到
	Pid            string         `bson:"Pid"`            //所属玩家Id
}

var MailCollectionName = "mail"

func (mail *MailDoc) CollectionName() string {
	return MailCollectionName
}
func (mail *MailDoc) Id_() interface{} {
	return mail.Id
}
func (mail *MailDoc) IdString() string {
	return mail.Id.Hex()
}
